<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "t_detection_heartrate".
 *
 * @property string $id
 * @property integer $user_id
 * @property string $category
 * @property double $heart_rate
 * @property string $source_data
 * @property string $chartUrl
 * @property integer $status
 * @property string $group_date
 * @property string $create_time
 */
class TDetectionHeartrate extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 't_detection_heartrate';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['user_id', 'heart_rate', 'status', 'group_date', 'create_time'], 'required'],
            [['user_id', 'status'], 'integer'],
            [['heart_rate'], 'number'],
            [['source_data'], 'string'],
            [['group_date', 'create_time'], 'safe'],
            [['category'], 'string', 'max' => 50],
            [['chartUrl'], 'string', 'max' => 200],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'user_id' => 'User ID',
            'category' => 'Category',
            'heart_rate' => 'Heart Rate',
            'source_data' => 'Source Data',
            'chartUrl' => 'Chart Url',
            'status' => 'Status',
            'group_date' => 'Group Date',
            'create_time' => 'Create Time',
        ];
    }

    /**
     * @inheritdoc
     * @return \app\models\query\TDetectionHeartrateQuery the active query used by this AR class.
     */
    public static function find()
    {
        return new \app\models\query\TDetectionHeartrateQuery(get_called_class());
    }
}
